package utility;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

public class ConfigManager extends PropertiesConfiguration {

	private static ConfigManager instance = null;

	private ConfigManager() {}

	public ConfigManager(String string) throws ConfigurationException {
		super(string);
	}

	public static ConfigManager getInstance() throws ConfigurationException {
		if (instance == null) instance = new ConfigManager("app.properties");
		return instance;
	}


	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		try {
			ConfigManager config = ConfigManager.getInstance();

			System.out.println(config.getList("testNodeAddress"));

			System.out.println(config.getString("registryAddress"));
		} catch (ConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
